package com.cartoon.controller;

import com.cartoon.entity.Collect;
import com.cartoon.service.CollectService;
import com.cartoon.util.ResponseData;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (Collect)表控制层
 *
 * @author makejava
 * @since 2021-12-10 11:28:08
 */
@RestController
@RequestMapping("collect")
public class CollectController {
    /**
     * 服务对象
     */
    @Resource
    private CollectService collectService;

     @GetMapping("getCollectCartoons")//获取收藏漫画
    public ResponseData getCollectCartoons(int userId){
         return collectService.getCollectCartoons(userId);
     }
     @GetMapping("insertCollectCartoons")//加入收藏
     public ResponseData insertCollectCartoons(Integer cartoonId,Integer userId){
         return collectService.insertCollectCartoons(cartoonId,userId);
     }
     @GetMapping("deleteCollectCartoon")//删除收藏漫画
     public ResponseData deleteCollectCartoon(Integer cartoonId,Integer userId){
         return collectService.deleteCollectCartoon(cartoonId,userId);
     }
}

